SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
7 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
1.3 KB · 29 lines tsx
Raw Blame History
1import { api } from "@/lib/api";2import { countryName, fmtDate } from "@/lib/format";3import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";4import { CLOUD_STATUS_LABEL } from "../cloud-format";56export const alt = "DataCenterIndex cloud region";7export const size = OG_SIZE;8export const contentType = OG_CONTENT_TYPE;9export const revalidate = 3600;1011export default async function Image({ params }: { params: Promise<{ slug: string }> }) {12  const { slug } = await params;13  const r = await api.cloudRegion(slug);14  if (!r.ok) return renderOg({ eyebrow: "Cloud region", title: "DataCenterIndex cloud regions", subtitle: "Public cloud regions by provider — location, availability zones, launch date, status." });15  const d = r.data;16  const country = d.countryName ?? (d.countryIso2 ? countryName(d.countryIso2) : null);17  return renderOg({18    eyebrow: d.provider.name,19    title: `${d.code} · ${d.name}`,20    subtitle: [d.city, country].filter(Boolean).join(", ") || undefined,21    stats: [22      { label: "Availability zones", value: d.availabilityZones === null ? "—" : String(d.availabilityZones) },23      { label: "Launched", value: fmtDate(d.launchedOn) },24      { label: "Status", value: CLOUD_STATUS_LABEL[d.status] },25      { label: "Country", value: country ?? "—" },26    ],27  });28}29